<!DOCTYPE html>
<html lang="en">
    <head>
        <title>练习模式</title>
        <meta charset="utf-8">
        <meta content="yes" name="apple-mobile-web-app-capable">
        <meta content="yes" name="apple-touch-fullscreen">
        <meta content="telephone=no,email=no" name="format-detection">	
		<link rel="stylesheet" href="/layui/css/layui.css">
		<script src="/layui/layui.js"></script>
        <script src="/js/flexible_css.js,flexible.js.js"></script>
        <link rel="apple-touch-icon" href="/favicon.png">
        <link rel="Shortcut Icon" href="/favicon.png" type="image/x-icon">
        <link rel="stylesheet" href="/css/reset.css?rev=@@hash">
        <link rel="stylesheet" href="/css/style.css?rev=@@hash">
       
    </head>
    <body>
        <input type="hidden" id="cId"/>
   
   
       <div class="loading" style="background-color:#000"></div>
      
	   <div id="wrapper" class="wrapper_contest displayFlex flexSit space_betweens spaceSize dasAutoSlight unitKind allInRoll cnimaLoop bokAutoIn cnimaLoop">
		<div id="scroller" class="datiList">
				<div class="practice_head">
					<span class="jsjs_text flo_l">练习模式</span>
                    <span class="flo_r"><span class="jsjs_text">计时</span>：<strong class="timer"><span class="minute_show">10</span> : <span class="second_show">00</span></strong></span>
					<div class="clearBoth"></div>
			    </div>
            <div class="question_con_wai displayFlex flexSit space_betweens spaceSize dasAutoSlight unitKind allInRoll">
                <div class="question_con">
                    <div class="quesBox displayFlex flexSit space_betweens spaceSize dasAutoSlight unitKind allInRoll cnimaLoop bokAutoIn space_beens space_between">
                        <!--                        <div class="quesBox_lie displayFlex flexSit space_betweens spaceSize dasAutoSlight unitKind allInRoll">-->
                        <!--                            <div class="tmtit flexSit space_betweens spaceSize dasAutoSlight unitKind space_beens space_between spacearo">-->
                        <!--                                <span>单选题</span>-->
                        <!--                                <span><span>1</span>/<span>5</span></span>-->
                        <!--                            </div>-->
                        <!--                            <div class="question_tm">俗称“长生果”指的是什么？</div>-->
                        <!--                            <div>-->
                        <!--                                <div class="question_xx res flexSit space_betweens spaceSize dasAutoSlight unitKind allInRoll space_between space_neens"><div class="">A.</div><div class="">花生</div><div class="iconfontes icon-duigoues abses"></div></div>-->
                        <!--                                <div class="question_xx res flexSit space_betweens spaceSize dasAutoSlight unitKind allInRoll space_between space_neens"><div class="">B.</div><div class="">花生</div><div class="iconfontes icon-duigoues abses"></div></div>-->
                        <!--                                <div class="question_xx res flexSit space_betweens spaceSize dasAutoSlight unitKind allInRoll space_between space_neens"><div class="">C.</div><div class="">花生</div><div class="iconfontes icon-duigoues abses"></div></div>-->
                        <!--                                <div class="question_xx res flexSit space_betweens spaceSize dasAutoSlight unitKind allInRoll space_between space_neens"><div class="">D.</div><div class="">花生</div><div class="iconfontes icon-duigoues abses"></div></div>-->
                        <!--                                <div class="question_xx res flexSit space_betweens spaceSize dasAutoSlight unitKind allInRoll space_between space_neens"><div class="">E.</div><div class="">花生</div><div class="iconfontes icon-duigoues abses"></div></div>-->
                        <!--                            </div>-->
                        <!--                        </div>-->
                    </div>

                    <button type="button" class="layui-btn layui-btn-fluid layui-btn-normal tjdj_btn hide">提交答卷</button>
                    <div class="sm_tips text_cener hide">说明:每个手机号仅有一次答题机会，请谨慎提交！</div>
                </div>
            </div>


        </div>
           <div class="tj_tc abs hide" >
               <div class="tjts_box auto_censp text_cener">
                   <div style="height: 1.5rem;"></div>
                   <span class="tips_mes"><i class="iconfont icon-duigou"></i>  提交成功！</span><br>
                   <div style="height: 0.35rem;"></div>
                   <span style="font-size: 0.38rem;">结果请在返回后答题模式选择中查看！</span>
                   <a href="/dth5/intype"> <button type="button" class="layui-btn layui-btn-fluid layui-btn-normal fh_btn">返回</button></a>
               </div>
           </div>
       </div>

        <script src="/js/zepto.min.js"></script>
        <script src="/js/common.js"></script>
        <script src="/js/iscroll.js"></script>
        <script src="/js/call.js?rev=@@hash"></script>

        <script type="text/javascript">
            $(function(){
                var userId=localStorage.getItem("userId");
                //竞赛答题列表
                $.ajax({
                    type: "GET",
                    url: "/dth5/ks",
                    contentType : "application/json;charset=utf-8",
                    dataType:"json",
                    data:{type:0,userId:userId},
                    success:function(data){
                        // debugger
                        var xxName=["A","B","C","D","E","F","G","H","I","J","K"];
                        window.localStorage.setItem("tcid",data.data.tcId);
                        if(data.code == 0){
                            for(var i=0;i<data.data.ti.length;i++){

                                var nxString="";

                                for(var j=0;j<data.data.ti[i].da.length;j++){
                                    nxString=nxString+
                                        '<div k="'+data.data.ti[i].da[j].k+'" class="question_xx res flexSit space_betweens spaceSize dasAutoSlight unitKind allInRoll space_between space_neens">'+
                                        '<div class="">'+xxName[j]+'.</div>'+
                                        '<div class="">'+data.data.ti[i].da[j].da+'</div>'+
                                        '<div class="iconfontes icon-duigoues abses"></div>'+
                                        '</div>'
                                }


                                var xxString='<div>'+nxString+'</div>';

                                $(".question_con .quesBox").append('<div index="'+i+'" tid="'+data.data.ti[i].tid+'" class="quesBox_lie displayFlex flo_l flexSit space_betweens spaceSize dasAutoSlight unitKind allInRoll">'+
                                    '<div class="tmtit flexSit space_betweens spaceSize dasAutoSlight unitKind space_beens space_between spacearo">'+
                                    '<span>单选题</span>'+
                                    '<span><span>'+(i+1)+'</span>/<span>'+data.data.ti.length+'</span></span>'+
                                    '</div>'+
                                    '<div class="question_tm">'+data.data.ti[i].title+'</div>'+
                                    xxString+
                                    '</div>');
                            }

                        }else{
                            alert(data.msg);
                        }
                    }
                });

                //竞赛答题提交
                $(".tjdj_btn").tap(function(){
                    if(!window.localStorage.getItem("tjList") || window.localStorage.getItem("tjList") == "[]"){
                        alert("请至少答一道题！");
                    }else{
                        $.ajax({
                            type: "GET",
                            url: "/dth5/jj2",
                            contentType : "application/json;charset=utf-8",
                            dataType:"json",
                            data:{"tiJiaoJuans":JSON.stringify({
                                    cid:window.localStorage.getItem("tcid"),
                                    uid:userId,
                                    type:0,
                                    uJiaoJuanList:window.localStorage.getItem("tjList"),
                                })},
                            success:function(data){
                                window.localStorage.setItem("tjList",JSON.stringify([]));
                                $(".tj_tc").removeClass("hide");
                                console.log(data);
                            }
                        });
                    }

                });


            });



        </script>



    </body>
</html>